package com.example.sbbsec.domain.constantenum;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * Created by lowe.yang on 8/04/2017.
 * 省份编码 经纬度
 */
@AllArgsConstructor
@Getter
@SuppressWarnings("all")
public enum ProvinceEnum {

    DEFAULT("", "空", "", ""),
    BEI_JING("11", "北京市", "116.405289", "39.904987"),
    TIAN_JIN("12", "天津市", "117.190186", "39.125595"),
    SHANG_HAI("31", "上海市", "121.472641", "31.231707"),
    CHONG_QING("50", "重庆市", "106.504959", "29.533155"),
    HE_BEI("13", "河北", "114.502464", "38.045475"),
    HE_NAN("41", "河南", "113.665413", "34.757977"),
    YUN_NAN("53", "云南", "102.71225", "25.040609"),
    LIAO_NING("21", "辽宁", "123.429092", "41.796768"),
    HEI_LONG("23", "黑龙江", "126.642464", "45.756966"),
    HU_NAN("43", "湖南", "112.982277", "28.19409"),
    AN_HUI("34", "安徽", "117.283043", " 31.861191"),
    SHAN_DONG("37", "山东", "117.000923", "36.675808"),
    XIN_JIANG("65", "新疆", "87.616880", "43.826630"),
    JIANG_SU("32", "江苏", "118.76741", "32.041546"),
    ZHE_JIANG("33", "浙江", "120.15358", "30.287458"),
    JIANG_XI("36", "江西", "115.892151", "28.676493"),
    HU_BEI("42", "湖北", "114.298569", "30.584354"),
    GUANG_XI("45 ", "广西", "108.320007", "22.82402"),
    GAN_SU("62", "甘肃", "103.834170", " 36.061380"),
    SHAN_XI("14", "山西", "112.549248", "37.857014"),
    NEI_MENG("15", "内蒙古", "111.751990", "40.841490"),
    SHAN_XI2("61", "陕西", "108.948021", "34.263161"),
    JI_LIN("22", "吉林", "125.324501", "43.886841"),
    FU_JIAN("35", "福建", "119.306236", "26.075302"),
    GUI_ZHOU("52", "贵州", "106.713478", "26.578342"),
    GUANG_DONG("44", "广东", "113.28064", "23.125177"),
    QING_HAI("63", "青海", "101.777820", "36.617290"),
    XI_ZANG("54", "西藏", "91.11450", "29.644150"),
    SI_CHUAN("51", "四川", "104.065735", "30.659462"),
    NING_XIA("64", "宁夏", "106.232480", "38.486440"),
    HAI_NAN("46", "海南", "110.199890,", "20.044220"),
    TAI_WAN("71", "台湾", "121.520076", "25.030724"),
    XIANG_GANG("81", "香港", "114.165460", "22.275340"),
    AO_MEN("82", "澳门", "113.549130", "22.198750");


    //编码
    private String code;

    //名称
    private String name;

    //经度
    private String longitude;

    //纬度
    private String latitude;

    public static ProvinceEnum getByCode(String key) {
        ProvinceEnum[] values = ProvinceEnum.values();
        for (ProvinceEnum value : values) {
            if (Objects.equals(value.getCode(), key)) {
                return value;
            }
        }

        return DEFAULT;
    }
}
